Add testing of pg_upgrade - #31
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
8a6a467 to
d05ccf0
Compare
6c1d36f to
e64f80f
Compare
e64f80f to
fb1431a
Compare
a9c46c2 to
a791789
Compare
a791789 to
03c7af9
Compare
03c7af9 to
acba0ca
Compare
acba0ca to
bc3c24e
Compare
bc3c24e to
031abc6
Compare
031abc6 to
7cb2293
Compare
7cb2293 to
80d37b7
Compare
3b33ad8 to
f37b039
Compare
f37b039 to
96d93f7
Compare
96d93f7 to
3c19783
Compare
ed6d991 to
0a67678
Compare
|
Claude finished @jnasbyupgrade's task in 5m 47s —— View job Code review
Overall this is a well-reasoned, carefully-commented PR — the two-leg matrix design (updating on opposite sides of the binary One real issue, otherwise minor:
assert_version() {
local db=$1 expected=$2 installed
[ "$expected" = current ] && expected=$(current_version)
...Under This is exactly the failure mode this file's own author already flagged and avoided a few lines below, in It's currently dormant — if [ "$expected" = current ]; then expected=$(current_version); fiNothing else stood out: the |
|
Claude finished @jnasbyupgrade's task in 2m 20s —— View job Code review
This push (
No bugs found in this diff. One item from the previous review remains open, since it's in a file this push didn't touch:
[ "$expected" = current ] && expected=$(current_version)Under if [ "$expected" = current ]; then expected=$(current_version); fi |
Adds the pg-upgrade-test CI job: install 0.9.6 on an old PostgreSQL major, plant + prove a dependency guard, binary pg_upgrade to a newer major, ALTER EXTENSION UPDATE the migrated objects, then run the suite against the real upgraded database in existing mode. bin/test_existing is much smaller than the equivalent script would have been pre-test/install: only prepare-old and run-suite are genuinely external-to-pg_regress concerns (a real pg_upgrade binary run isn't something pg_regress can invoke itself), plus a small `update` subcommand for the post-upgrade ALTER EXTENSION UPDATE step. There's no update-scenario subcommand at all - that entire scenario is just `make test-update` now (test/install/load.sql's own 'update' mode, added in phase 3), since an in-place update has no external step to drive. run_suite() gates on plain `make test`, not the old belt-and-suspenders `make test && make verify-results` - pgxntool 2.3.0 (this repo's phase 0) already made `make test` itself exit non-zero on regression failures. Not yet crossed with TEST_SCHEMA - that's the next phase, once both this job and extension-update-test can cross it together. Verified locally against PG17 (prepare-old -> update -> run-suite, without a real pg_upgrade - this container's clusters are persistent shared infra, so the actual binary pg_upgrade leg is left for CI's ephemeral containers, same reasoning as the pg-tle-test work). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… not after Reorders prepare-old -> update -> pg_upgrade -> run-suite (was prepare-old -> pg_upgrade -> update -> run-suite). The old order proved pg_upgrade could migrate 0.9.6's frozen objects, then updated afterward - not actionable, since that version already shipped. This job's whole point is proving pg_upgrade correctly migrates the objects count_nulls' CURRENT code creates, which requires updating BEFORE the binary upgrade runs. make install (into the old cluster) already happens earlier in the job, so the current version's update scripts are on disk in time for the moved step. Updates the job's step names/comments and bin/test_existing's own file-header sequence description to match the new order.
Propagates the draft-PR gating from phase3.5-ci-hygiene to the pg-upgrade-test job introduced by this branch: same needs:[changes]/ if: docs_only pattern as pg-tle-test, so it gets the same && github.event.pull_request.draft != true guard.
old_pg=12 keeps updating to current before the binary pg_upgrade (proves pg_upgrade preserves CURRENT-code objects); old_pg=10 now updates after instead (proves pg_upgrade preserves objects still frozen at the oldest supported version at upgrade time - a real user scenario the update-before-only setup missed). Same 2-leg matrix, no added CI cost. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…n databases The old_pg=10-vs-12 split wrongly conflated two independent axes (which PG floor is tested, and which update-order is tested). Both orderings are now compared on the SAME floor (old_pg=10, the oldest supported) using twin databases migrated by a single pg_upgrade call - the same trick this file already uses to cross TEST_SCHEMA without doubling matrix legs. old_pg=12 reverts to its original single-database, single-ordering design and is now just a second, unrelated old-PG-floor data point.
…oded majors old_pg=["10","12"] had no technical justification for the second leg (no dependency-version SQL, no other package tie) and old_pg=10 stopped being the real floor once #51 derived it as 9.4 from META.json. Add a floor_pg output to the changes job (same $FLOOR already computed for supported_pg, just re-emitted as a bare scalar like newest_pg) and drive both old_pg and new_pg from those single sources of truth instead of separately hardcoded literals. With only one leg left, the matrix.old_pg == '10'/'12' conditionals that used to pick which twin-database ordering(s) to run no longer make sense - both orderings now always run unconditionally.
d714ef5 to
83b6214
Compare
|
Claude finished @jnasbyupgrade's task in 2m 5s —— View job Code review
This push ( The change collapses
No bugs found in this diff. One item from the previous two reviews remains open, since it's in a file this push didn't touch:
[ "$expected" = current ] && expected=$(current_version)Under if [ "$expected" = current ]; then expected=$(current_version); fi |
…g consumers The comments explaining supported_pg/newest_pg/floor_pg (and the newest_pg bare-scalar rationale) tied each output's reason for existing to a specific downstream job/feature (test's draft-PR matrix reduction, pg-upgrade-test's legs) and, for floor_pg, narrated the PR #51 history of the bug it fixed. Rework them to just state what each value is and its general purpose, so the comment doesn't need updating every time a new consumer is added or removed.
|
Claude finished @jnasbyupgrade's task in 1m 1s —— View job Code review
This push ( No bugs found in this diff. One item from the previous three reviews remains open, since it's in a file this push didn't touch:
[ "$expected" = current ] && expected=$(current_version)Under if [ "$expected" = current ]; then expected=$(current_version); fi |
…n db names pg-start's own NO_CLUSTER option lets us install PostgreSQL and create the old pg_upgrade-test cluster with --data-checksums in one step, instead of starting a default cluster only to immediately stop/drop/recreate it. Also drop the redundant count_nulls_ prefix from the twin database names (upgrade_oldest_first/upgrade_current_first) - we're already inside the count_nulls repo/test suite.
|
Claude finished @jnasbyupgrade's task in 1m 28s —— View job Code review
This push (
No bugs found in this diff, and no regressions: every job in the run, including all One item from the previous three reviews remains open, since it's in a file this push didn't touch:
[ "$expected" = current ] && expected=$(current_version)Under if [ "$expected" = current ]; then expected=$(current_version); fi |
[ "$expected" = current ] && expected=$(current_version) aborts the whole script silently whenever $expected isn't literally "current": under `set -e`, a false left side of && makes the compound command's exit status non-zero, which is fatal. Switch to `if`, matching the same fix already applied to update_ext() a few lines below.
|
Claude finished @jnasbyupgrade's task in 48s —— View job Code review
This push ( - [ "$expected" = current ] && expected=$(current_version)
+ if [ "$expected" = current ]; then expected=$(current_version); fiThis resolves the only issue raised across all five previous reviews of this PR. Confirmed:
No bugs found. All previously-flagged issues in this PR are now resolved. |
Adds binary
pg_upgradecoverage — proving count_nulls' objects survive a real PostgreSQL major-version upgrade, not just an in-placeALTER EXTENSION UPDATE. This can't live inside a plainpg_regressrun sincepg_upgradeis an external binary process.What this does
New
pg-upgrade-testCI job: install the oldest version we still ship a full script for on the oldest PostgreSQL major count_nulls supports, plant a dependency guard (so an accidentalCASCADEdrop anywhere in the job can't silently make this test a fresh install instead), binarypg_upgradeto the newest supported major, then run the suite against the real migrated database.A single leg tests both real-world orderings a user could hit — updating the extension before upgrading PostgreSQL, and updating it after — via twin databases migrated by the same
pg_upgradecall, so it only costs one binary upgrade instead of two. See the job's own comment for why one PostgreSQL floor is enough to cover both orderings.bin/test_existingfactors out the pieces that are genuinely external topg_regress(preparing the old cluster, running the suite via--use-existingagainst the real upgraded database afterward) into a small, reusable script rather than inline CI YAML — modeled on the equivalent script inPostgres-Extensions/cat_tools.Not yet crossed with
TEST_SCHEMA.Verification
Real CI run confirms the full flow end to end: both twin-database orderings, the binary
pg_upgradecall itself, and the suite passing against the migrated objects. Locally (this container's own PostgreSQL clusters are persistent shared infra, not disposable, so the actual binarypg_upgradestep is CI-only):prepare-old→update→run-suiteall pass standalone.